<template>
  <div>
    <h1>App组件</h1>
    <Count ref="count"/>
  </div>
</template>

<script lang="ts">
import {defineComponent} from "vue";

export default defineComponent({
  name: "App",
});

</script>

<script lang="ts" setup>
// 引入组件
import Count from "./components/Count/index.vue";
import {onMounted, ref} from "vue";

// 获取ref对象  申明的变量必须和 定义的 ref 的值 一模一样
const count = ref()

onMounted(() => {
  console.log(count)
  console.log(count.value)
  console.log(count.value.countNum)
})

</script>

<style scoped>

</style>